package com.ethink.warehouse.converter;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import com.ethink.framework.common.converter.Converter;
import com.ethink.warehouse.api.info.MateInventoryAdjustLogDetailInfo;
import com.ethink.warehouse.common.entity.MateInventoryAdjustLogDetail;

/**
 * 库存矫正明细 Converter转换器
 *
 * @author default
 * @date 2022-11-17
 */
@Component
public class MateInventoryAdjustLogDetailConverter implements Converter<MateInventoryAdjustLogDetailInfo, MateInventoryAdjustLogDetail> {

    @Override
    public MateInventoryAdjustLogDetail convertTo(MateInventoryAdjustLogDetailInfo info) {
        if(info == null) {
            return null;
        }
        MateInventoryAdjustLogDetail entity = new MateInventoryAdjustLogDetail ();
        BeanUtils.copyProperties(info, entity);
        return entity;
    }

    @Override
    public MateInventoryAdjustLogDetailInfo convertFrom(MateInventoryAdjustLogDetail entity) {
        if(entity == null) {
            return null;
        }
        MateInventoryAdjustLogDetailInfo info = new MateInventoryAdjustLogDetailInfo();
        BeanUtils.copyProperties(entity, info);
        return info;
    }
}
